package com.image.androidimagebroswer;

import android.app.Application;

import com.image.androidimagebroswer.data.MediaData;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * Created by liuzhao.futrue on 2018/8/26.
 */

public class ImageBroswerApplication extends Application {

    @Override
    public void onCreate() {
        super.onCreate();

        // 异步获取图片数据，避免数据库操作造成的卡顿
        ExecutorService service = Executors.newSingleThreadExecutor();
        service.execute(new Runnable() {
            @Override
            public void run() {
                MediaData.loadPhotos(ImageBroswerApplication.this);
            }
        });

    }
}
